package com.vdong.trade.trading.entity.mo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.RequiredArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易表
 *
 * @author zhoulongbiao
 * @Date 2018/12/4 18:50
 */
@Data
@Entity
@Builder
@AllArgsConstructor
@RequiredArgsConstructor
@Table(name = "`trading`")
public class TradingMO {
    /**
     * id
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 用户id
     */
    @Column(name = "user_id")
    private Long userId;

    /**
     * 用户姓名
     */
    @Column(name = "name")
    private String name;

    /**
     * 用户类型
     */
    @Column(name = "user_type")
    private String userType;

    /**
     * 业务类型
     */
    private Short dealType;

    /**
     * 系统类型
     */
    @Column(name = "sys_type")
    private String sysType;

    /**
     * 流水号
     */
    @Column(name = "wechat_data_id")
    private Long wechatDataId;

    /**
     * 订单编号
     */
    @Column(name = "order_no")
    private String orderNo;

    /**
     * 金额
     */
    @Column(name = "money")
    private BigDecimal money;

    /**
     * 交易类型 1：进账 2出账
     */
    @Column(name = "trade_type")
    private String tradeType;

    /**
     * 进账账户(账户表id)
     */
    @Column(name = "account_enter")
    private Long accountEnter;

    /**
     * 出账账户(账户表id)
     */
    @Column(name = "account_out")
    private Long accountOut;

    /**
     * 支付类型 1:微信支付
     */
    @Column(name = "pay_type")
    private String payType;

    /**
     * 是否有效  0 ：无效 1：有效
     */
    @Column(name = "status")
    private String status;

    /**
     * 是否结算 0：未结算 1：已结算
     */
    @Column(name = "settlement_status")
    private String settlementStatus;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "update_time")
    private Date updateTime;
}
